******************
**** Table B3 ****
****************** 


use "$data/paymentdata_ready" , clear


keep if t==1

log using "$output/table b3", replace

 
* Column 1 *
capture program drop Ey_boot
program define Ey_boot, eclass
twopm interventionsumpaymentw1 treatmentidentityd2 treatmentidentityd3 treatmentidentityd4  ///
firststickerdummy* teamdummy*  lastdebt_demeanedw1 prepaymentsmadedummy* presuminvoicew1 presumpaymentw1 /// 
, firstpart(probit) secondpart(regress) vce(cluster dayteam)
margins, dydx(treatmentidentityd2 treatmentidentityd3 treatmentidentityd4) nose post
end
bootstrap _b, seed(340) reps(1000): Ey_boot

* Column 2 *
capture program drop Ey_boot
program define Ey_boot, eclass
twopm postsumpaymentw1 treatmentidentityd2 treatmentidentityd3 treatmentidentityd4  ///
firststickerdummy* teamdummy*  lastdebt_demeanedw1 prepaymentsmadedummy* presuminvoicew1 presumpaymentw1 /// 
, firstpart(probit) secondpart(regress) vce(cluster dayteam)
margins, dydx(treatmentidentityd2 treatmentidentityd3 treatmentidentityd4) nose post
end
bootstrap _b, seed(340) reps(1000): Ey_boot

* Column 3 *
 capture program drop Ey_boot
program define Ey_boot, eclass
twopm sumpaymentw1 treatmentidentityd2 treatmentidentityd3 treatmentidentityd4  ///
firststickerdummy* teamdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummyB* presuminvoicew1 presumpaymentw1 /// 
, firstpart(probit) secondpart(regress) vce(cluster dayteam)
margins, dydx(treatmentidentityd2 treatmentidentityd3 treatmentidentityd4) nose post
end
bootstrap _b, seed(340) reps(1000): Ey_boot

log close
